#ifndef QSENDFILEDIALOG_H
#define QSENDFILEDIALOG_H

#include "fileitem.h"
#include <QDialog>
#include <QFileInfo>
#include <QMouseEvent>
#include <QMimeData>
#include <QRegularExpression>
#include <QDebug>

namespace Ui {
class QSendFileDialog;
}

class QSendFileDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QSendFileDialog(QWidget *parent = nullptr);
    ~QSendFileDialog();
    void addFile(const QString filePath);
    void setCurrentObject(const QString &email,const QString &name);
    void closeClicked();
protected:
    void mousePressEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent* event);
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);
signals:
    void sendFile(const QString &email,QList<QString> fileList);
private slots:
    void deleteFileItem(FileItem* item);
private:
    Ui::QSendFileDialog *ui;
    QString email;
    bool isDragging=false;
    QPoint lastPos;
    void updateItemNum(const int &num);
    QList<QString> getFileList();
};

#endif // QSENDFILEDIALOG_H
